import { getArticles, getBasicInfo } from '@/api/api';
import ScrollList from '@/components/scroll-list';
import { articleType, queryParamsType } from '@/utils/model';

export async function getStaticProps() {
  const [baseInfo, result] = await Promise.all([getBasicInfo(), getArticles()]);
  console.log('🚀 ~ file: staticPage.tsx:5 ~ getStaticProps ~ baseInfo:', baseInfo);
  return {
    props: {
      list: result.data,
      pagationInfo: result,
      baseInfo,
    },
  };
}
const Home = ({
  list = [],
  pagationInfo,
}: {
  list: articleType[];
  pagationInfo: queryParamsType;
}) => {
  console.log('🚀 ~ file: index.tsx:16 ~ Home ~ list:', list);
  return (
    <>
      <ScrollList list={list} pageInfo={pagationInfo} />
    </>
  );
};
export default Home;
